package com.bolt.admin.module.sys.entity;

import com.bolt.support.spring.jpa.entity.BaseTreeAuditingEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.*;

import javax.persistence.*;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 菜单对象
 * Created by Administrator on 2017/9/28.
 */

@Access(AccessType.FIELD)
@Entity
@Table(name = "SYS_MENU2")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@DynamicInsert
@DynamicUpdate
@Data
@NoArgsConstructor
public class MenuEntity extends BaseTreeAuditingEntity<Long,MenuEntity> {

    public MenuEntity(Long id) {
        this.id = id;
    }

    @Id
    @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "native")
    private Long id;

    @Column(name = "NAME", nullable = false, length = 32)
    private String name;

    @Column(name = "URL", length = 256)
    private String url;


    @Column(name = "icon", length = 128)
    private String icon;


    @Column(name = "DESCRIPTION", length = 255)
    private String description;


}
